import pygame

pygame.init()

w,h = 1000,800
pygame.display.set_mode((w,h))
screen = pygame.display.get_surface()

# 载入素材
bg = pygame.image.load("E:\work\pycharm\gitee\\test\helloWorld\justPlay\ourSatoshi\Animations\ground\Default\\bg.png")
bg = pygame.transform.scale(bg,(w,h))

satoshi_image = pygame.image.load('E:\work\pycharm\gitee\\test\helloWorld\justPlay\ourSatoshi\\satoshi.png')

satoshi = pygame.sprite.Sprite()
satoshi.image = satoshi_image
satoshi.rect = satoshi.image.get_rect()
satoshi.rect.x,satoshi.rect.y = w/2,h/2

# player
player_group = pygame.sprite.Group()
player_group.add(satoshi)


# 跑起来!
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.display.quit()
            quit()

        if event.type == pygame.KEYDOWN:
            keys = pygame.key.get_pressed()
            if keys[pygame.K_DOWN]:
                satoshi.rect.y += 15
            if keys[pygame.K_UP]:
                satoshi.rect.y -= 15

    screen.blit(bg,(0,0))
    player_group.draw(screen)
    pygame.display.update()


